home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / satellit / pacdoc / broadcst.doc < prev    next >
Text File  |  1990-09-05  |  38KB  |  884 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                          PACSAT Broadcast Protocol
  7.                                                
  8.  
  9.                            Harold E. Price, NK6K
  10.                              Jeff Ward, G0/K8KA
  11.  
  12.  
  13.  
  14.                                   ABSTRACT
  15.  
  16.  
  17.  
  18.      The case for a broadcast protocol for use on PACSATs is made, and 
  19.      a suitable protocol is proposed.  In the proposed protocol, files 
  20.      of general interest are chopped into <UI> frames and repeatedly 
  21.      sent by the PACSAT in round-robin fashion or on request.  Each 
  22.      <UI> frame datagram contains enough information for groundstation 
  23.      software to place the frame in the correct position in the appro-
  24.      priate file.  Information indicating the type of file being re-
  25.      ceived is also included in each frame.
  26.  
  27.      A protocol for groundstations to request retransmissions of spe-
  28.      cific frames is included.
  29.  
  30.  
  31.  
  32. 1.0 Background
  33.  
  34.  
  35. PACSAT is a generic term used to describe a digital store-and-forward satel-
  36. lite mission in the Amateur Radio Service.  Two of four Microsats and one of 
  37. two UoSATs launched in January 1990 will have PACSAT as a primary missions.
  38.  
  39. PACSATs will use the AX.25 frame as the basic link layer protocol, either in 
  40. the full AX.25 connected mode, or as unconnected <UI>-frame datagrams.
  41.  
  42. A PACSAT will have several types of data to send.  Some of these are:
  43.  
  44. 1) Forwarded mail messages.  These are messages are not destined for PACSAT as 
  45. an endpoint, but are in transit between forwarding gateway stations.
  46.  
  47. 2) Personal electronic mail messages.  These are messages to and from individ-
  48. uals who are using the satellite as a BBS; entered either directly by a human-
  49. run connection, or by using a program that pre-formats messages for fast or 
  50. unattended transmission.  These messages use PACSAT as an endpoint.  It can be 
  51. argued that all mail should be forwarded mail, that no one use PACSAT as a 
  52. direct BBS.  There are three counter arguments:
  53.  
  54. a) For access in remote areas without a terrestrial infrastructure in place.
  55.  
  56. b) For emergency access by minimal ground stations.
  57.  
  58. c) To permit large numbers of people to have a direct hands-on experience with 
  59. satellite communications.
  60.  
  61.  
  62. 3) Realtime Telemetry.  These are current spacecraft telemetry values, such as 
  63. solar array power, internal temperature, etc.
  64.  
  65. 4) Stored Telemetry.  This is a file of one or more telemetry values stored 
  66. over time, for example, the output of the solar arrays once a second over the 
  67. last orbit.  This is usually called ``Whole Orbit Data'' or ``WOD''.
  68.  
  69. 5) Bulletins.  These are items of general interest, orbit predictions, AMSAT 
  70. News, Gateway, etc.
  71.  
  72. 6) Point-to-multipoint messages.  These are messages which one PACSAT user 
  73. wishes to send to several other PACSAT end users.  This may be implemented 
  74. using ``mail groups'' or ``CC'' lists.
  75.  
  76. Items 1) and 2) above are primarily point to pointoperations, either an indi-
  77. vidual reading his own mail, or a gateway forwarding mail to be picked up by 
  78. another gateway.
  79.  
  80. Item 3) is a self-contained frame that needs no other frames to convey its 
  81. information.
  82.  
  83. The other items are germane to this discussion.  Both are data types that 
  84. would be of interest to a large number satellite users people.  Any time that 
  85. more than one user is interested in the same information, it will generally 
  86. make more sense to broadcast it (send it once for reception by many) rather 
  87. than send the information separately to each individual.  
  88.  
  89. Current terrestrial packet radio use is highly inefficient.  If 160 people in 
  90. southern California want to read the 20k byte ARRL Gateway newsletter, they 
  91. each log into a BBS and read it separately.  This requires 3.2MB of data to be 
  92. sent.  Because of packet overhead, collisions, acks, etc., the actual number 
  93. of bytes sent, and the total channel time, is much higher.
  94.  
  95. Assuming a very optimistic average throughput of 120 bytes/second, it takes 
  96. 7.5 hours of channel time to allow 160 people to get a copy of the bi-weekly 
  97. Gateway.  Taking the standard loaded aloha 18% of that figure, 42 hours of 
  98. channel time are required.  Because there are 24 hours in a day, and there are 
  99. seven packet channels in use on 2 meters alone in southern California, it is 
  100. possible to accumulate 42 hours of channel time in less than a day.  The 
  101. inefficiency of the system is masked by the large amount of time and RF spec-
  102. trum available.
  103.  
  104. Now assume that one wished to distribute Gateway on a Microsat, an environment 
  105. where time and spectrum are at a premium. The Microsat is visible for about 14 
  106. minutes a pass, or about 60 minutes a day.  It would then take 42 days to 
  107. accumulate 42 hours of channel time, since even though the Microsat has multi-
  108. ple uplinks, it has only one downlink.  UoSAT-3 (UO-14), with its 9600 baud 
  109. downlink, would require only 5 days to move the same data.
  110.  
  111. Even if we assume a very disciplined set of users who access the satellite one 
  112. at a time, we can move the efficiency from 18% to nearly 95%, enabling UO-14 
  113. to service the 160 users in 1.5 days, and Microsat in 8.5.  This is assuming 
  114. all of the single downlink frequency was devoted to the activity of download-
  115. ing Gateway to individual users.
  116.  
  117. There are several conclusions that can be drawn from this.  One is that a 
  118. PACSAT is useless for dealing with a large number of individual users if they 
  119. all want individual copies of the same file.  It would be far better to have a 
  120. gateway in the local area read a copy, then distribute it on the ground for 
  121. everyone else. This is, however, not much different than what we have now, and 
  122. we're looking to use the satellite to improve general conditions.
  123.  
  124. Another conclusion is that if there were a way to send a single copy of Gate-
  125. way that could be seen by all 160 users at the same time, this would reduce 
  126. both the load on the satellite, and the load on the terrestrial network.  
  127. Since the satellite CAN see all 160 users in southern California at one time, 
  128. the solution is now clear.
  129.  
  130. A broadcast protocol for items of general interest is clearly desirable.  A 
  131. strong case for one can be made in the terrestrial network as well, but the 
  132. multiplicity of frequencies and the 24 hour availability of VHF/UHF networks 
  133. makes the advantages harder to see.  The single downlink of a PACSAT, and the 
  134. tyranny of orbital mechanics makes the need more evident in the satellite 
  135. environment.  In a broadcast mode, UO-14 can transmit at least 3.2 million 
  136. bytes of data to a station in the mid latitudes in an average day, AO-16 and 
  137. LO-19 can each send at least 432,000.  That is a lot of mail.
  138.  
  139. There is another advantage to a broadcast protocol, and again, it is more 
  140. telling in the satellite service.  A broadcast protocol, being one way, does 
  141. not require a transmitter at the receiving site.  The complexity of the ground 
  142. station is reduced as the 2 meter transmitter and its antenna are not required 
  143. to receive the broadcast.
  144.  
  145. Finally, the PACSAT environment gives another encouragement to broadcast 
  146. protocols: because the transmit and receive frequencies are on different 
  147. bands, it is inherently full-duplex.  Since PACSAT will be the only transmit-
  148. ting station on the downlink, a major source of data-loss, collisions with 
  149. other stations, is removed.  When the link is good, there is no need for 
  150. retransmissions, making the broadcast protocol more efficient than the normal 
  151. ACK/timeout AX.25 protocol.
  152.  
  153.  
  154. 2.0 Attributes of a Broadcast Protocol
  155.  
  156. The AX.25 protocol, in its connected mode, makes the following guarantees:
  157.  
  158. 1)  All bytes are received once, in the order they were sent, with no gaps.
  159.  
  160. 2)  No bytes are received in error (within the limits of CRC16).
  161.  
  162. This means that the two stations can establish a connection, and then send a 
  163. file.  When the expected number of bytes or an end of file marker is received 
  164. the receiving station can assume that it received the entire file (or message) 
  165. correctly.
  166.  
  167. The general philosophy is that the sending and receiving stations work togeth-
  168. er to retransmit each frame (or small group of frames, 1-7) repeatedly until 
  169. it is received correctly, before moving on to the next frame.
  170.  
  171. The connected mode requires two-way point to point transmissions, and is not 
  172. suitable for a broadcast protocol.
  173.  
  174. The unconnected mode of AX.25 make these guarantees:
  175.  
  176. 1) Byte order is maintained within a frame only.
  177.  
  178. 2) No bytes in a frame are received in error (within the limits of CRC16).
  179.  
  180. One or more frames may be missing within a group of frames.  Although some 
  181. TNCs allow you to receive frames with CRC errors, you can receive no reliable 
  182. indication that you have missed a frame.  AX.25 does not provide frame se-
  183. quence numbers in these frames.  You can not know if the frame you have just 
  184. received immediately follows the previously received frame, or if you missed 
  185. some. 
  186.  
  187. Although on average, the new PACSATs have the strongest amateur satellite 
  188. signals to date, the receiving station will still get occasional dropouts from 
  189. local conditions, polarity reversals due to the spacecraft's changing orienta-
  190. tion, 70cm radar, etc.  Loss of signal as the spacecraft goes over the horizon 
  191. will also cause a loss of frames.
  192.  
  193. All of this means that if you receive a file as a set of broadcast <UI> 
  194. frames, AX.25 itself does not provide enough information to allow you to tell 
  195. if the entire file has been received, or if it has gaps.  A broadcast protocol 
  196. must provide this missing information.  The broadcast protocol wouldride 
  197. inside a standard AX.25 <UI> frame.
  198.  
  199. Ideally, the broadcast protocol would have the following attributes:
  200.  
  201. 1)  Any frame, when received independently, can be placed in the proper loca-
  202. tion within the file to which it belongs.
  203.  
  204. 2)  When the all frames have been received, the receive station can tell that 
  205. the file is complete.
  206.  
  207. 3)  For file types where it makes sense, partial files should be usable.  For 
  208. example, if a data compression scheme is used, the file should be able to be 
  209. incrementally decompressed, e.g., a 20000 bytes of a 20256 byte file should 
  210. not be useless simply because the first 256 bytes are missing. 
  211.  
  212. To carry this to full frame independence, this means that compression algo-
  213. rithms should be such that the decompression of one frame does not depend on 
  214. the receipt of any other frame.  This may require the use of a less-efficient 
  215. compression algorithm for files which are to be incrementally decompressed, 
  216. but partial files, and perhaps all of the information, can be extracted from a 
  217. smaller set of received frames.
  218.  
  219. Files that are not meant to be incrementally decompressed may use any compres-
  220. sion scheme, the broadcast protocol maintains data transparency.
  221.  
  222. Four rules can be derived from the above desires:
  223.  
  224. 1)  Each frame must contain a file identifier
  225.  
  226. 2)  Each frame must contain something that identifies this frame's position in 
  227. the file.
  228.  
  229. 3)  The file must contain a special record that defines file attributes, 
  230. particularly file size.  Other items of interest would be the actual file 
  231. name, creation date, etc.
  232.  
  233. 4)  If a partial file is to be usable, especially if compression is used, each 
  234. frame must contain enough information to allow use of a partial file.
  235.  
  236.  
  237. 2.0.1 Additional Error Protection
  238.  
  239. It is most likely that TNCs operating in KISS mode will be used to receive the 
  240. UI frames which make up PACSAT Broadcasts.  The authors' experiments indicate 
  241. that the link between the KISS TNC and the user's personal computer may be 
  242. prone to errors caused by a lack of flow control.  This is especially true 
  243. when using high radio data rates such as UoSAT-OSCAR-14's 9600 baud link.  
  244.  
  245. Although the AX.25 CRC assures that only correctly received frames will be 
  246. passed on by the KISS TNC to the host computer, we are now not certain that 
  247. the frame reaching the host computer is error free.  If we process incorrectly 
  248. received frames, even occasionally, files will be lost or corrupted.  Thus, we 
  249. must add some error protection to the broadcast frame.
  250.  
  251. After experimentation, a 16-bit CRC was selected.
  252.  
  253. 2.1 Frame Header Contents
  254.  
  255. The above rules define a frame structure that looks like this:
  256.  
  257.  
  258. <flags><file_id><file_type><offset><data><crc>
  259.  
  260.  
  261. Each field is discussed below.
  262.  
  263. 2.1.1 file_id
  264.  
  265. At first glance, the simplest file id would be the actual name of the file.  
  266. Since the PACSAT file system permits 8 bytes of name and 3 bytes of extension, 
  267. this would lead to 11 bytes of overhead per frame, or 4%.  This is somewhat 
  268. large.  There is also the problem that the contents of a file named 
  269. ``error.log'' may change, and so the file name is not truly a unique file 
  270. identifier.
  271.  
  272. To overcome this problem PACSAT assigns each created file a ``file number'', 
  273. which is 4-bytes long and will uniquely identify the file.  This number is 
  274. used as the file_id in the Broadcast Protocol header.
  275.  
  276. The receiving station will not know the actual name of the file until the file 
  277. header record is received.  This record could be transmitted more frequently 
  278. than other records, increasing the chances that it would be available in any 
  279. partially-received file.
  280.  
  281. 2.1.2 offset
  282.  
  283. Each frame of broadcast data must contain the position in the file where the 
  284. data came from.  Each frame, then, contains an offset field.  The offset is 
  285. the byte number of the first byte in that frame, relative to the first byte in 
  286. the file.  For PACSAT files, byte 0 is always the first byte of the PACSAT 
  287. File Header.
  288.  
  289. To place a received data frame into a file, one need only:
  290.  
  291.      lseek((long) offset);
  292.      write(handle, data, frame_size);
  293.  
  294. While it is easy to insert the frame bytes into the file, it is much harder to 
  295. know when all the bytes have been received.  There are several methods, one is 
  296. maintaining a list of holes in the file, much as some TCP/IP implementations 
  297. do when reassembling IP packets.
  298.  
  299. The size of the offset field is important, too small and the size of broadcast 
  300. files are limited, too large and the overhead for each file is increased.  
  301. We've chosen 24 bits as a compromise between efficiency and maximum file size.  
  302. This allows for files up to 16Mb.
  303.  
  304. 2.1.3 Flags
  305.  
  306. The flag field is a byte which provides option bits. Two bits are currently 
  307. defined.  ``Length'' says that an option length field is present in the frame 
  308. header.  ``EOF'' says that this is the last frame of the associated file.
  309.  
  310. 2.1.4 File_type
  311.  
  312. If a partial file, which could be just a single frame,  is to be useful, some 
  313. information on the file type must be provided with each frame.  Examples of 
  314. file types are:
  315.  
  316.      ASCII text bulletins 
  317.      Images from UoSAT-E CCD
  318.      Stored telemetry
  319.      Digitized voice
  320.      Machine-ready Keplerian element updates
  321.      Incrementally decompressable files
  322.      Non-decompressable files
  323.  
  324. The file_type can also inform the groundstation software that a file is incre-
  325. mentally decompressable, or not compressed at all.
  326.  
  327. The file_type byte is the same byte which is found in the file header record 
  328. in the file.  File types are assigned and defined in a separate document.
  329.  
  330. 2.1.5 data
  331.  
  332. This part of the frame is the file data, compressed or uncompressed.   The 
  333. file_type can be used to tell what type of data is present.
  334.  
  335.  
  336. 2.1.6 CRC
  337.  
  338. Reception errors in the AX.25 UI frame can be detected using the 16-bit CRC 
  339. which is part of the HDLC frame, and this low-level error detection would, 
  340. ideally, be enough to protect the Broadcast protocol frames.  However, in 
  341. reality, the UI frames are usually received by a KISS TNC, and the link be-
  342. tween the KISS tnc and the host computer may be unreliable (especially at high 
  343. speed) due to the lack of flow control in the KISS standard.  For this reason, 
  344. we have chosen to append a 16-bit CRC to the broadcast frame WITHIN the AX.25 
  345. UI frame data field.  This CRC will be calculated using the XMODEM CRC speci-
  346. fication, which has been successfully and efficiently implemented on many 
  347. microcomputers.
  348.  
  349. 2.1.7 File Header
  350.  
  351. Clearly, the 8-bit file_type and the 32-bit file_id cannot convey all of the 
  352. information which a groundstation needs to know about a file (e.g. time of 
  353. creation, complete file name, file size).  This information is in a structure 
  354. at the beginning of each file.  The file header may be of variable length, but 
  355. would contain an offset to the first user data byte.   The header is always at 
  356. start of the file, with a byte offset of 0.
  357.  
  358. A proposal for a standard PACSAT File Header is provided in a separate docu-
  359. ment.
  360.  
  361. 2.2 Binary Data
  362.  
  363. For greatest efficiency, all header information is coded in binary.  This is a 
  364. departure from previous amateur digital satellite philosophy.
  365.  
  366. Currently, UO-9, AO-10, UO-11, and AO-13 transmit telemetry and bulletins in 
  367. uncompressed Ascii.  This was, in part, to make this information available to 
  368. the widest possible audience.  The audience was a late 1970/early 1980 audi-
  369. ence, and was assumed to have only the modem and a terminal, with little or no 
  370. computer assistance.  Telemetry on all of the above satellites can be read in 
  371. Ascii and decoded with pencil and paper.  The amount of telemetry generated is 
  372. small, and the broadcast data is bi-weekly bulletins.  
  373.  
  374. PACSATs are being designed for a 1990s environment.  A new piece of hardware 
  375. is required, either an external TNC, or an add-on card for your computer.  In 
  376. almost all cases, a computer is present at the ground station.  The number of 
  377. users who must deal directly with the raw data is reduced, perhaps to zero.
  378.  
  379. An increased emphasis on compressed data will lead to downlink which is mostly 
  380. binary anyway.  Several ground station programs are planned or already avail-
  381. able which will allow users to monitor the downlink and acquire the data.  The 
  382. authors plan to make public domain source and shareware programs available for 
  383. the IBM PC, with proceeds going to AMSAT-NA and AMSAT-UK.
  384.  
  385.  
  386. 3.0 PACSAT Broadcast - How it works in practice
  387.  
  388. PACSAT command stations would upload files tagged with a broadcast rotation 
  389. priority and an expiration date.  On-board programs would also be able to tag 
  390.  
  391. or build files with this data.  An onboard broadcast administrator task main-
  392. tains a list of active broadcast files and assigns a file_id.  Files would be 
  393. broadcast based on their rotation priority, i.e., files with low priority 
  394. would be sent less often that those with high priority.  Files under some 
  395. threshold priority would only be sent during otherwise idle downlink time, 
  396. those above the threshold would be mixed in with whatever else is on the 
  397. downlink.  Since parsing binary data (the header) in the standard monitor mode 
  398. of TNCs is non-trivial, we can assume that the KISS mode, or other host mode 
  399. will be used to implement the ground program.  Therefore the PID byte in the 
  400. frame can easily be used to identify broadcast protocol frames.  The exact 
  401. value is 0xbb.
  402.  
  403. Ground users would run a program that monitors the downlink for frames.  This 
  404. program would probably use the KISS mode of the TNC.  As each frame was re-
  405. ceived, the file_id and offset field of the frames are used to build up an 
  406. image of the file.  Duplicate frames are discarded. Several files can be 
  407. active at once.  
  408.  
  409. A utility program is provided to convert the received files into a usable 
  410. form.  It can decompress compressed files, and handle partial files if possi-
  411. ble.  It will display the contents of the PACSAT File Header record in re-
  412. ceived files.  It can also generate a hole list or bit map, as required, to 
  413. send to PACSAT and request retransmission of missing parts of the file.
  414.  
  415.  
  416. 4.0 Extensions
  417.  
  418. So far this discussion has assumed that all files on PACSAT can be divided 
  419. into two groups: broadcast files which are sent with the broadcast protocol, 
  420. and point-to-point files which are sent using AX.25 connected mode.  There is 
  421. also a gray area: point-to-multipoint files, which are not of interest to all 
  422. PACSAT groundstations, but might be of interest to more than one station in 
  423. the same PACSAT footprint.  For instance, a message to all TCP/IP users would 
  424. not warrant a continuous broadcast, but it might be downloaded by several 
  425. groundstations.  One would like to arrange things so that when the first 
  426. groundstation downloads ``TCPIP.UPD'', other users in the broadcast-listen 
  427. mode would also receive and avoid downloading it themselves (if they're inter-
  428. ested).  There are two ways of achieving this: by using the broadcast mode 
  429. when the first groundstation requests the file, or by embedding broadcast mode 
  430. datagrams in the connected-mode frames.
  431.  
  432. Using the first method, the user would connect to PACSAT and request that a 
  433. file or files be put in the broadcast rotation.  The user would then discon-
  434. nect and use his broadcast-listen program to receive the desired files.  (The 
  435. user could even avoid connecting in the first place by transmitting the file 
  436. request in a <UI> frame on the uplink.)  
  437.  
  438. Files added to the broadcast list this way would be sent at a high priority 
  439. for the length of an average pass.
  440.  
  441. Users who do not receive the file completely while it is being broadcast can 
  442. send a description of the missed data (hole-list) to the PACSAT and those 
  443. blocks would placed in the broadcast rotation.  Re-transmission requests for a 
  444. particular file can come from many stations, but by the nature of the round-
  445. robin broadcast, requests are not likely to be synchronized and cause a mass 
  446. uplink collision.
  447.  
  448. Thus, we use the broadcast mode for all but explicitly point-to-point files.
  449.  
  450. The alternative is for the PACSAT to connect to one station and commence 
  451. standard AX.25 transfer, but embed enough information into the <I> frames to 
  452. allow ``eavesdropping'' stations to build up copies of the file being trans-
  453. ferred.  Thus, to every <I> frame PACSAT adds the standard broadcast mode 
  454. header, for the benefit of stations which may be listening in on the connec-
  455. tion.  Unfortunately, the connected mode user has no idea where each <I> frame 
  456. begins and ends, so his software cannot strip out the unwanted header informa-
  457. tion. Thus, we set the L bit in the <flags> field and place frame length in 
  458. the <length> field.  Now the connected mode user knows where each frame begins 
  459. and can strip out the header.
  460.  
  461. This may stick in the gullet of pure layered protocol designers.  In defense 
  462. of the proposal we offer the facts that (1) the broadcast <UI> frame listener 
  463. already relies on knowing where the level-2 frames begin and end; and (2) we 
  464. can look on our frame format as a higher-level packet format, and it just so 
  465. happens that each packet fits in one frame (for the benefit of the ``eaves-
  466. droppers'').
  467.  
  468.  
  469. 5.0 Incremental Decompression
  470.  
  471. Incremental decompression is the ability to decompress partial files.  In the 
  472. most general case, any frame can be decompressed independently of any other 
  473. frame.
  474.  
  475. It should be noted that the desire for incremental decompression has several 
  476. deleterious effects.  Primarily, it forces the use of non-optimal compression 
  477. techniques.
  478.  
  479. Some compression schemes, such as Huffman coding, require that a table be sent 
  480. along with the file that provides deciding information.  The file is not 
  481. decodable without this table, so a partial file that did not include the table 
  482. would be useless.  To allow use of Huffman-style coding, files would have to 
  483. be compressed with a small number of standard tables that can be encoded in 
  484. the file type.
  485.  
  486. Many compression methods, including Huffman coding, turn a file into tokens of 
  487. variable bit length.  That is, a token will not necessarily be an integral 
  488. number of octets long, whereas an AX.25 frame must be an integral number of 
  489. octets long.  An arbitrary frame can be decoded only if the start of the frame 
  490. is also the start of a token, and we know the number of meaningful bits in the 
  491. frame.
  492.  
  493. Also, the program doing the broadcast framing may not be the program that did 
  494. the compression.  This would require, for instance, that PACSAT decompress the 
  495. file as it broadcasts it, so it could properly align frames and tokens.
  496.  
  497. Decompression of partial files is an area for further discussion.  To allow 
  498. maximum flexibility in future implementation, the proposed standard includes 
  499. the possibility of variable length frames.  If the length bit in the flag byte 
  500. is set, the two bytes following the standard frame header are the number of 
  501. valid bits in the block.  This allows for bit tokens of a non-integer number 
  502. of octets.
  503.  
  504. It should be noted that the WO-18 image transmission format is a form of 
  505. broadcast with incremental decompression, allowing even a single frame of the 
  506. compressed image to be placed in it proper location on the display screen.
  507.  
  508.  
  509. 6.0 Broadcast Advantages
  510.  
  511. Receive-only stations with just an omni antenna and an eavesdrop program can 
  512. accumulate bulletins, telemetry, and other items of general interest just by 
  513. listening.  
  514.  
  515. For transmit and receive stations, if one other station is interested in the 
  516. same file, then overhead is reduced by at least 100%.  This should justify the 
  517. additional few percent overhead of the broadcast information.
  518.  
  519.  
  520. 7.0 Broadcast Disadvantages
  521.  
  522. Nearly everything broadcast from PACSAT would have several bytes of binary 
  523. data in the front of each frame.  This would make it difficult to monitor with 
  524. just a TNC and terminal.  Since the assumption is made that the data will also 
  525. be compressed, a computer and proper program would be required in any case, so 
  526. it is unlikely there will be any TNC-only stations. We also note that most of 
  527. current fleet of spacecraft are already transmitting telemetry in raw binary 
  528. form.
  529.  
  530. Due to the difficulty of parsing binary data from the standard monitor mode of 
  531. TNCs, only TNCs with the KISS protocol, or other host-mode protocol, will be 
  532. suitable.  It may be possible, depending of the availability of true 8-bit 
  533. transparency, to use the monitor mode on some TNCs, since a known, fixed 
  534. string would precede each monitored frame, e.g., ``>QST-1:''.
  535.  
  536.  
  537. 8.0  Implementation Status
  538.  
  539. UO-14 has been broadcasting files using the protocol defined in Appendix A. 
  540. since mid summer.  AO-16 and LO-19 should begin using this format by the end 
  541. of August.
  542.  
  543.  
  544. 9.0  Proposed Broadcast Protocol
  545.  
  546. The protocol specification is provided as Appendix A to this paper.
  547.  
  548.  
  549. 10.0  Correspondence
  550.  
  551. Address comments to:
  552.  
  553.  
  554. Telemail:            HPRICE or UOSAT
  555. Compuserve:          71635,1174
  556. Packet:              NK6K @ WB6YMH
  557.                     or G0K8KA @ GB2UP
  558. Internet:            71635.1174
  559.                     @COMPUSERVE.COM
  560. Mail:               Jeff Ward
  561.                     UoSAT Unit
  562.                     University of Surrey
  563.                     Guildford, Surrey  GU2 5XH
  564.                     UK
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572. Appendix A.
  573.  
  574.  
  575.  
  576. A.1  PACSAT Broadcast Protocol Description
  577.  
  578.  
  579.  
  580. This protocol describes a method where files can be sent from a PACSAT to an 
  581. unknown number of groundstations, using the unconnected <UI> frame mode of 
  582. AX.25.  The protocol could also be used in purely terrestrial applications.
  583.  
  584. Each file that is to be broadcast is assigned a 32-bit file id.  This number 
  585. must be unique among all other files broadcast by this station.  A station 
  586. must be able to later match the file id with the file if the station is to 
  587. handle retransmission requests.
  588.  
  589. When a file is broadcast, it is broken down into frames.  Each frame is iden-
  590. tified with enough information so that the data can be placed in the proper 
  591. location and in the proper file by a receive-only groundstation.  Each frame 
  592. is sent within an AX.25 <UI> frame, and is totally contained within that <UI> 
  593. frame.
  594.  
  595. Some files are automatically retransmitted enough times over several passes so 
  596. that the likelihood of a station receiving all parts of the file at least once 
  597. with no errors is high.  A facility is also provided to allow a ground station 
  598. to request the transmission of certain frames to allow fills of missing data.
  599.  
  600. The PACSAT Broadcast Protocol has two elements, the File Transmission Frame, 
  601. use to send data; and the File Request Frame, used to request retransmission 
  602. of all or part of a file.
  603.  
  604. A.2 File Transmission frame format
  605.  
  606. A.2.1 Frame
  607.  
  608. A broadcast frame consists of a header, data and a CRC .  The header is varia-
  609. ble length, depending on bits in the flag byte.  The data may also be of 
  610. variable length. 
  611.  
  612. The broadcast frame is wholly contained within a standard AX.25 <UI> frame.  
  613. The total length of the broadcast frame may not exceed the length of a legal 
  614. AX.25 <UI> frame.
  615.  
  616. A <UI> frame containing a broadcast frame uses a PID of 0xbb.
  617.  
  618. A <UI> frame containing a broadcast frame uses a source address of the trans-
  619. mitting station, and a destination address of QST-1.
  620.  
  621.  
  622. A.2.1.1 Frame Header
  623.  
  624. Each frame contains a frame header, which occupies the first n bytes of the 
  625. frame.  The structure of the frame header is as follows:
  626.  
  627.      <flags><file_id><file_type><offset>[<length>]
  628.  
  629. This structure follows the PACSAT Data Specification Standards as regards 
  630. field size and byte order, which is defined in a separate document.
  631.  
  632. struct FRAME_HEADER {
  633.      unsigned char flags;
  634.      unsigned long file_id;
  635.      unsigned char file_type;
  636.      unsigned int offset;
  637.      unsigned char offset_msb;
  638.      };
  639.  
  640. or
  641.  
  642.  
  643. struct FRAME_HEADER_EXT {
  644.      unsigned char flags;
  645.      unsigned long file_id;
  646.      unsigned char file_type;
  647.      unsigned int offset;
  648.      unsigned char offset_msb;     
  649.      unsigned int length;           /* only present if L bit set */
  650.      };
  651.  
  652. flags          A bit field as follows:
  653.  
  654.      7  6  5  4  3  2  1
  655.     /-------------------\
  656.     |*  *  0  V  V  O  L|
  657.     \-------------------/
  658.  
  659. L              1    length field is present
  660.                0    length field not present
  661.  
  662. E              1    Last byte of frame is the last byte of the file.
  663.                0    Not last.
  664.  
  665. VV                  Two bit version identifier.  This version is 0.
  666.  
  667. 0                   Always 0.
  668.  
  669. *                   Reserved, must be 0.
  670.  
  671.  
  672.  
  673. file_id         A number which identifies an active broadcast file.  All 
  674. frames which are part of the same file are tagged with this number.
  675.  
  676. file_type       The file_type byte from the file header.  Provided so that 
  677. partial files received without the header can be decoded.  File types are 
  678. defined in a separate document.
  679.  
  680. length          If the L bit is set, this field is present it in the header.  
  681.  
  682. It is the number of bits that are to be used in the data field.  This field 
  683. has two intended uses: when variable length blocks are used with the broadcast 
  684. carried inside a higher level protocol (so that the frame length is lost), and 
  685. when a non-integer number of octets of data are used.
  686.  
  687. offset          If the O bit is not set, this is the block number of the 
  688. block.  If the O bit is set, this is  the offset from the start of the file 
  689. for the first byte in this frame.  This field is the lower  16 bits of a 24 
  690. bit integer.
  691.  
  692. offset_msb      The high order 8 bits of the offset.
  693.  
  694.  
  695. A.2.1.2 Data
  696.  
  697. If the block mode is used, the length of the data must be fixed.  It may be 
  698. any length, but the following must be true:
  699.  
  700.   file_offset_of_first_byte_in_frame = offset * this_frame_size
  701.  
  702. All frames in a particular transmission of a file should be the same length, 
  703. to avoid having the receiver resize his bit map too often.
  704.  
  705. If byte numbers rather than block numbers are used, the data may be any 
  706. length.  If the length field is present, the data must contain only that 
  707. number of bits, rounded up to the next octet boundary.  
  708.  
  709. A.2.1.3 CRC
  710.  
  711. A two-byte CRC as defined by the XMODEM protocol follows the data.  The crc 
  712. covers all data bytes in the AX.25 UI frame, including the broadcast frame 
  713. header.
  714.  
  715. An inefficient definition routine for checking the XMODEM CRC when receiving a 
  716. frame is:
  717.  
  718. unsigned short crc;              /* global crc register.              */
  719. crc = 0;                         /* clear crc register                */
  720. for (all received data bytes)
  721.     gen_crc(rx_byte);            /* crc the incoming data bytes       */
  722. gen_crc(1st_crc_byte);           /* crc the incoming first crc byte   */
  723. if(gen_crc(2nd_crc_byte))        /* crc the incoming second crc byte  */
  724.  bad_crc();                      /* non-zero crc reg. is an error     */
  725. else
  726.  good_crc();                     /* zero crc is a good packet.        */
  727. /* Function to take a byte and run it into the XMODEM crc generator.  */
  728. /* Uses a global CRC register called ``crc''.                           */
  729.  
  730. gen_crc(data)
  731. char data;
  732. {
  733.     int y;
  734.     crc ^= data << 8;
  735.     for(y=0; y < 8; y++)
  736.         if( crc & 0x8000)
  737.             crc = crc << 1 ^ 0x1021;
  738.         else
  739.             crc <<= 1;
  740.     return crc;
  741. }
  742.  
  743. Further information on generation of XMODEM CRC via more efficient byte-wise 
  744. methods can be found in BYTE Magazine,  September 1986, pp. 115-124.
  745.  
  746.  
  747. A.3 File Retransmission Request Format
  748.  
  749. Each request to retransmit portions of a file is sent in a retransmission 
  750. request frame.  If more data is being requested than will fit in one request, 
  751. multiple requests may be sent.
  752.  
  753. This protocol is intended to service retransmissions of already-broadcast 
  754. files.  The manner is which a file is first requested to be broadcast is a 
  755. more complex topic, including, presumably, the ability to request files based 
  756. on name, date, content, keywords, mail message copy list, etc.
  757.  
  758. A.3.1 Request Frame
  759.  
  760. A request frame consists of a header and data.  The header is fixed length.  
  761. The data depends on the type field in the header, and can be of variable 
  762. length.
  763.  
  764. The request frame is wholly contained within a standard AX.25 <UI> frame.  The 
  765. total length of the broadcast frame may not exceed the length of a legal AX.25 
  766. <UI> frame.
  767.  
  768. A <UI> frame containing a request frame uses the same PID as a broadcast 
  769. frame, 0xbb.  The source address is the address of the transmitting station, 
  770. the destination address is the address of the station to which the request is 
  771. directed.  Thus, if a frame has the PACSAT Broadcast Protocol PID , if the 
  772. destination is QST-1, it is a broadcast frame, otherwise it is a request 
  773. frame.
  774.  
  775. A.3.2 Request Format
  776.  
  777. A.3.2.1 Header
  778.  
  779. The format of request is:
  780.  
  781. <type><file_id><data>
  782.  
  783.      struct REQUEST_HEADER {
  784.           char flags;
  785.           unsigned long file_id;
  786.           int block_size;
  787.           };
  788.  
  789.  
  790. flags          - A bit field as follows:
  791.  
  792.      7  6  5  4  3  2  1
  793.     /-------------------\
  794.     |*  *  1  V  V  C  C|
  795.     \-------------------/
  796.  
  797. CC                  Two bit field as follows:
  798.  
  799.                00   start sending file <file_id>
  800.                01   stop sending file <file_id>
  801.                10   Frame contains a hole list.  
  802.  
  803. VV                  Two bit version identifier.  This version is 0.
  804.  
  805. 1                   Always 1.
  806.  
  807. *                   Reserved, must be 0.
  808.  
  809.  
  810. block_size      Requests that the broadcast use this value as a maximum 
  811. size. 
  812.  
  813. file_id         File id of the requested file.  
  814.  
  815.  
  816. A.3.2.1 Data
  817.  
  818. If the CC field is 2, a hole list is present. 
  819.  
  820. The format of the hole list is pairs of start addresses and lengths.
  821.  
  822. struct PAIR {
  823.      unsigned int offset;
  824.      unsigned char offset_msb;
  825.      unsigned int length;
  826.      };
  827.  
  828.  
  829. The length of the hole list is determined by received frame size.
  830.  
  831.  
  832. A.4 PROCEDURES
  833.  
  834. A.4.1 Identification of a broadcast protocol data frame.
  835.  
  836. The broadcast protocol will use a special PID 0xbb.  Broadcast frames with be 
  837. sent with a source callsign of the station's call, and a destination callsign 
  838. of <QST-1>.
  839.  
  840. A.4.2 File transmission
  841.  
  842. Multiple broadcast files may be transmitted simultaneously, frames from one 
  843. file can be interleaved with another.  Frames can be transmitted in any order 
  844. and repeated at any time.
  845.  
  846. A.4.3 File completion
  847.  
  848. The file header contains the total number of bytes in the file.  Once the 
  849. ground station has received that number of bytes, the file is complete.  The 
  850. file header also contains checksums which can be used to verify the correct 
  851. reception of the file.
  852.  
  853.  
  854. Appendix B.
  855.  
  856. B. Legalities Within the Amateur Satellite Service
  857.  
  858. The use of the words ``broadcast'' and ``compression'' sometimes raise the 
  859. hackles of certain members of the amateur community.  ``Broadcast'' is men-
  860. tioned in the Amateur Rules (Part 97 of the FCC regulations), and compression 
  861. is sometimes equated with encryption.
  862.  
  863.  
  864. B.1 Broadcast
  865.  
  866. To establish the bona-fides of a broadcast protocol:
  867.  
  868. 97.113(d)(2) specifically permits information bulletins consisting solely of 
  869. subject matter relating to amateur radio.
  870.  
  871. The prohibited items are communications intended to be received directly by 
  872. the public (1200/4800/9600 baud PSK HDLC should take care of that), or for 
  873. newsgathering for broadcast purposes.
  874.  
  875.  
  876. B.2 Compression
  877.  
  878. 97.117 specifically permits the use of abbreviations or signals where the 
  879. intent is not to obscure the meaning but only to facilitate communications.  
  880. Compression using published algorithms to increase data throughput would thus 
  881. be permitted.
  882.  
  883. 
  884.